package com.shy.springframework.core.convert;

import com.sun.istack.internal.Nullable;

/**
 * @author yzpang
 * @desc: 类型转换服务
 * @date: 2023/2/14 16:53
 */
public interface ConversionService {

    /**
     * 能否转换判断
     * @param sourceType
     * @param targetType
     * @return
     */
    boolean canConvert(@Nullable Class<?> sourceType, Class<?> targetType);

    <T> T convert(Object source, Class<T> targetType);
}
